﻿using System.Windows;
using System.Windows.Controls;

namespace AEM.Controls
{
    /// <summary>
    /// OuterFloor.xaml 的交互逻辑
    /// </summary>
    public partial class OuterFloor : UserControl
    {
        public OuterFloor()
        {
            InitializeComponent();
        }

        private static void OnIsUpChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            if (args.NewValue != args.OldValue)
            {
                (sender as OuterFloor).up_ring.Visibility = (Visibility)args.NewValue;
            }
        }

        private static void OnIsDownChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            if (args.NewValue != args.OldValue)
            {
                (sender as OuterFloor).down_ring.Visibility = (Visibility)args.NewValue;
            }
        }

        public static readonly DependencyProperty IsUpProperty =
            DependencyProperty.Register("IsUp", typeof(Visibility), typeof(OuterFloor),
           new FrameworkPropertyMetadata(Visibility.Hidden, new PropertyChangedCallback(OnIsUpChanged)));

        public Visibility IsUp
        {
            get { return (Visibility)GetValue(IsUpProperty); }
            set { SetValue(IsUpProperty, value); }
        }

        public static readonly DependencyProperty IsDownProperty =
            DependencyProperty.Register("IsDown", typeof(Visibility), typeof(OuterFloor),
           new FrameworkPropertyMetadata(Visibility.Hidden, new PropertyChangedCallback(OnIsDownChanged)));

        public Visibility IsDown
        {
            get { return (Visibility)GetValue(IsDownProperty); }
            set { SetValue(IsDownProperty, value); }
        }
    }
}
